// Patch console.warn at the global level
try {
  const originalWarn = console.warn;
  Object.defineProperty(console, 'warn', {
    value: function(message, ...args) {
      if (typeof message === 'string' && message.includes('findDOMNode')&& message.includes('DOMNodeInserted')) {
        return;
      }
      originalWarn.apply(console, [message, ...args]);
    },
    configurable: true,
    writable: true
  });
} catch (error) {
  console.error('Failed to patch console.warn:', error);
}

//手机调试使用
// import VConsole from 'vconsole';
// const vConsole = new VConsole();
// console.log('Hello, vConsole!');

import { createRoot } from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import './index.scss'
import './theme.css'
import App from './App.jsx'
import { UserProvider } from './context/UserContext.jsx';
import { Provider } from 'react-redux'
import store from './store'

createRoot(document.getElementById('root')).render(
  <BrowserRouter>
    <UserProvider>
      <Provider store={store}>
        <App />
      </Provider>
    </UserProvider>
  </BrowserRouter>

)
